package com.gaoqi.mq.Work;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 模拟rabbitMQ work 工作模式 消费者
 */
@Component
@Slf4j
public class WorkConsumer {


    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receive1MessageOfWork(String message){
        log.info("消费者1:消费"+message);
    }

    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receive2MessageOfWork(String message){
        log.info("消费者2:消费"+message);
    }
}
